const BusinessError =require('./BusinessError')
class ParamVerifyError extends BusinessError {
  constructor(message) {
    super(message||'参数校验失败');
    this.name = this.constructor.name;
    this.errorCode='100000'
  }
}
//参数类型错误
class ParamVerifyTypeError extends BusinessError {
  constructor(paramName) {
    super(`参数${paramName}类型错误`);
    this.name = this.constructor.name;
    this.errorCode='100001'
  }
}
//参数缺失
class ParamVerifyMissError extends BusinessError {
  constructor(paramName) {
    super(`必要参数${paramName}缺失`);
    this.name = this.constructor.name;
    this.errorCode='100002'
  }
}
//参数业务校验错误
class ParamVerifyBusinessError extends BusinessError {
  constructor(message) {
    super(message);
    this.name = this.constructor.name;
    this.errorCode='100003'
  }
}

module.exports={
  ParamVerifyError,
  ParamVerifyTypeError,
  ParamVerifyMissError,
  ParamVerifyBusinessError
}
